<div class="row">
  <div class="col-sm-1"></div>
  <div class="col-xs-12 col-sm-10">
    <div class="panel panel-default">
      <div class="panel-heading">用户中心关注公众号按钮</div>
      <div class="panel-body">
        <div class="form-group">
          <label class="control-label col-xs-12 col-sm-2">是否显示:</label>
          <div class="col-xs-12 col-sm-8">
            <div class="radio">
              <label for="row[page_my_follow_mp_btn]-1">
                <input id="row[page_my_follow_mp_btn]-1" name="row[page_my_follow_mp_btn]" type="radio" value="1" data-config='exam_visible' {notempty name="$row.page_my_follow_mp_btn" }{eq name="$row.page_my_follow_mp_btn" value="1" }checked{/eq}{else/}checked{/notempty}/>
                显示
              </label>

              <label for="row[page_my_follow_mp_btn]-0">
                <input id="row[page_my_follow_mp_btn]-0" name="row[page_my_follow_mp_btn]" type="radio" value="0" data-config='exam_visible' {notempty name="$row.page_my_follow_mp_btn" }{eq name="$row.page_my_follow_mp_btn" value="0" }checked{/eq}{else/}checked{/notempty}/>
                隐藏
              </label>
            </div>
          </div>
        </div>

        <div id="page_my_follow_mp_btn-1">
          <div class="form-group">
            <label class="control-label col-xs-12 col-sm-2">点击事件:</label>
            <div class="col-xs-12 col-sm-8">
              <div class="radio">
                <label for="row[page_my_follow_mp_click]-article">
                  <input id="row[page_my_follow_mp_click]-article" name="row[page_my_follow_mp_click]" type="radio" value="article" {notempty name="$row.page_my_follow_mp_click" }{eq name="$row.page_my_follow_mp_click" value="article" }checked{/eq}{else/}checked{/notempty}/>
                  跳转公众号文章
                </label>

                <label for="row[page_my_follow_mp_click]-image">
                  <input id="row[page_my_follow_mp_click]-image" name="row[page_my_follow_mp_click]" type="radio" value="image" {notempty name="$row.page_my_follow_mp_click" }{eq name="$row.page_my_follow_mp_click" value="image" }checked{/eq}{else/}checked{/notempty}/>
                  弹窗显示二维码
                </label>
              </div>
            </div>
          </div>

          <div class="form-group" id="page_my_follow_mp_click-article">
            <label class="control-label col-xs-12 col-sm-2">文章链接:</label>
            <div class="col-xs-12 col-sm-8">
              <input id="c-follow_mp_article_url" class="form-control" name="row[follow_mp_article_url]" type="text" value="{$row['follow_mp_article_url']|default=''}">
            </div>
          </div>

          <div class="form-group" id="page_my_follow_mp_click-image">
            <label class="control-label col-xs-12 col-sm-2">二维码图片:</label>
            <div class="col-xs-12 col-sm-8">
              <div class="input-group">
                <input id="c-follow_mp_image" class="form-control" size="50" name="row[follow_mp_image]" value="{$row['follow_mp_image']|default=''}" type="text">
                <div class="input-group-addon no-border no-padding">
                  <span>
                    <button type="button" id="plupload-follow_mp_image" class="btn btn-danger plupload"
                            data-input-id="c-follow_mp_image"
                            data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp" data-multiple="false"
                            data-preview-id="p-follow_mp_image">
                      <i class="fa fa-upload"></i> {:__('Upload')}
                    </button>
                  </span>
                  <span>
                    <button type="button" id="fachoose-follow_mp_image" class="btn btn-primary fachoose"
                            data-input-id="c-follow_mp_image" data-mimetype="image/*" data-multiple="false">
                      <i class="fa fa-list"></i> {:__('Choose')}
                    </button>
                  </span>
                </div>
                <span class="msg-box n-right" for="c-follow_mp_image"></span>
              </div>
              <ul class="row list-inline plupload-preview" id="p-follow_mp_image"></ul>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>

  <script src="__CDN__/assets/libs/jquery/dist/jquery.min.js"></script>
  <script>
    $(document).ready(function () {
      bindPageMyFollowMpBtn();
      bindPageMyFollowMpClick();
    });

    /**
     * 绑定我的页面关注按钮事件
     */
    function bindPageMyFollowMpBtn() {
      var showMyFollowMpBtn = function (page_my_follow_mp_btn) {
        if (page_my_follow_mp_btn == 1) {
          $('#page_my_follow_mp_btn-1').show(200);
        } else {
          $('#page_my_follow_mp_btn-1').hide(200);
        }
      };

      var page_my_follow_mp_btn = $('input[name="row[page_my_follow_mp_btn]"]:checked').val();
      showMyFollowMpBtn(page_my_follow_mp_btn);
      $(document).on('click', "input[name='row[page_my_follow_mp_btn]']", function () {
        let page_my_follow_mp_btn = $(this).val();
        showMyFollowMpBtn(page_my_follow_mp_btn);
      });
    }

    /**
     * 绑定我的页面关注按钮事件
     */
    function bindPageMyFollowMpClick() {
      var showMyFollowMpClick = function (page_my_follow_mp_click) {
        if (page_my_follow_mp_click == 'article') {
          $('#page_my_follow_mp_click-article').show(200);
          $('#page_my_follow_mp_click-image').hide(200);
        } else {
          $('#page_my_follow_mp_click-article').hide(200);
          $('#page_my_follow_mp_click-image').show(200);
        }
      };

      var page_my_follow_mp_click = $('input[name="row[page_my_follow_mp_click]"]:checked').val();
      showMyFollowMpClick(page_my_follow_mp_click);
      $(document).on('click', "input[name='row[page_my_follow_mp_click]']", function () {
        let page_my_follow_mp_click = $(this).val();
        showMyFollowMpClick(page_my_follow_mp_click);
      });
    }

  </script>

</div>